<script type="text/javascript">
    var status = '<?php echo $_GET['status'];?>';
    if(status == '-1'){
        alert('fail:<?php echo $_GET['msg'];?>');
    }
    function on_submit(){
        var uid = $("#uid").val();
        var password = $("#password").val();
        if(!uid){
            alert('用户ID不能为空');
            return;
        }
        if(!password){
            alert('密码不能为空');
            return;
        }
        var url = "index.php?c=user&m=admin_edit";
        var param = {"uid":uid,"password":password, "submits" : 1};
        common_ajax(url, param, function(data){
            if(data.errorCode == 0) {
                window.location.href=  window.location.href;
                return true;
            }else{
                alert(data.errorMsg);
            }
        });

    }
    $("#admin_edit").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
    });
</script>
<div class="tab-pane active" id="horizontal-form">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h2 class="modal-title"><?php echo $pageTitle;?></h2>
    </div>

    <form class="form-horizontal" id="admin_edit_form" action="index.php?c=<?php echo $_REQUEST['c'];?>&m=<?php echo $_REQUEST['m'];?>" name="form" method="post">
        <input type="hidden" name="submits" value="1"/>
        <div class="form-group">
            <label for="u_id" class="col-sm-2 control-label">用户ID：</label>
            <div class="col-sm-4">
                <input type="text" name="uid" id="uid" value="" class="form-control"/>
            </div>
            <div class="col-sm-2">
                <p class="help-block">不能为空</p>
            </div>
        </div>
        <div class="form-group">
            <label for="u_id" class="col-sm-2 control-label">添加密码：</label>
            <div class="col-sm-4">
                <input type="text" name="password" id="password" value="" class="form-control"/>
            </div>
            <div class="col-sm-2">
                <p class="help-block">不能为空</p>
            </div>
        </div>


        <div class="modal-footer">
            <button type="reset" class="btn btn-default" data-dismiss="modal">关闭</button>
            <button type="button" onclick="on_submit()" class="btn btn-primary">保存</button>
        </div>

    </form>
</div>